package parser;

public class Indicator implements Comparable<Indicator>{

	public Indicator(
			final String descriptionStr,
			final char indicator,
			final String descGerman,
			final Repeatability repeatability,
			final String descEnglish) {
		this.descriptionStr = descriptionStr;
		this.indicatorChar = indicator;
		this.descGerman = descGerman;
		this.descEnglish = descEnglish;
		this.repeatability = repeatability;
	}

	@Override
	public int hashCode() {
		return indicatorChar;
	}

	@Override
	public boolean equals(final Object obj) {
		if (obj == null) {
			return false;
		}
		if (this == obj) {
			return true;
		}
		if (!(obj instanceof Indicator)) {
			return false;
		}
		Indicator other = (Indicator) obj;
		if (indicatorChar != other.indicatorChar) {
			return false;
		}
		return true;
	}

	@Override
	public String toString() {
		String s = "";
		if (descriptionStr != null) {
			s += "'" + descriptionStr + "' ";
		}
		return s + "$" + indicatorChar + " " + descGerman + " (" + repeatability + ")";
	}

	public final String descriptionStr;
	public final char indicatorChar;
	public final String descGerman;
	public final String descEnglish;
	public final Repeatability repeatability;
	@Override
	public int compareTo(Indicator o) {
		return this.indicatorChar - o.indicatorChar;
	}

}
